﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2023 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Core.Entities;

/// <summary>
/// 数据配置
/// </summary>
[Comment("数据配置")]
[Table("Sys_DataConfig")]
[SugarIndex("Index_{table}_PId", nameof(SysDataConfig.PId), OrderByType.Asc)]
[SugarIndex("Index_{table}_Key", nameof(SysDataConfig.Key), OrderByType.Asc)]
[SugarIndex("Index_{table}_PKey", nameof(SysDataConfig.PKey), OrderByType.Asc)]
[SugarIndex("Index_{table}_Sort", nameof(SysDataConfig.Sort), OrderByType.Asc)]
[SugarIndex("Index_{table}_CreationTime", nameof(CreationTime), OrderByType.Desc)]
public class SysDataConfig : FullEntityNoIdentity, IExtensionData
{
    /// <summary>
    /// Json数据 
    /// </summary>
    [SugarColumn(ColumnDescription = "扩展字段", ColumnDataType = StaticConfig.CodeFirst_BigString, IsJson = true, IsNullable = true)]
    public Dictionary<string, object>? ExtensionData { get; set; }

    /// <summary>
    /// 父Id
    /// </summary>
    [Comment("父Id")]
    public long PId { get; set; }

    /// <summary>
    /// 关键词
    /// </summary>
    [Comment("关键词")]
    [MaxLength(200)]
    public string Key { get; set; }

    /// <summary>
    /// 父Key
    /// </summary>
    [Comment("PKey")]
    [MaxLength(200)]
    public string PKey { get; set; }

    /// <summary>
    /// 名称
    /// </summary>
    [Comment("名称")]
    [MaxLength(200)]
    public string Name { get; set; }

    /// <summary>
    /// 值
    /// </summary>
    [Comment("值")]
    public string Value { get; set; }

    /// <summary>
    /// 值扩展
    /// </summary>
    [Comment("值扩展")]
    public string ValueEx { get; set; }

    /// <summary>
    /// 分组
    /// </summary>
    [Comment("分组")]
    public string GroupName { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [Comment("排序")]
    public int Sort { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    [Comment("是否启用")]
    public bool IsEnable { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [Comment("备注")]
    public string Remark { get; set; }

    /// <summary>
    /// 层级
    /// </summary>
    [Comment("层级")]
    public int Level { get; set; }

    /// <summary>
    /// 层级路径
    /// </summary>
    [Comment("层级路径")]
    public string LevelPath { get; set; }
}